#include <iostream>
#include <stdio.h>

using namespace std;

struct Cls{
    int sum;
    int avg;
    int len;
};

Cls c[100000];



int main() {
    int n;
    cin >> n;
    int k = 0;
    int gsum = 0;
    int gavg = 0;
    for(int i = 1; i <= n ; i++){
        scanf("%d",&c[i].len);
        for(int j = 1; j <= c[i].len; j++){
            scanf("%d",&k);
            c[i].sum += k;
        }
        c[i].avg = c[i].sum / c[i].len;
        gsum += c[i].avg;
    }
    gavg = gsum / n;

    for(int i = 1; i <= n ; i++){
        if(c[i].avg < gavg){
            cout << i << ' ';
        }
    }
    return 0;
}